package view.custombar
{
	
	import com.util.MakeChildrenUtil;
	
	import flash.display.Stage;
	import flash.events.MouseEvent;
	
	import xm.components.button.SWCButton;
	import xm.control.bar.base.BarBase;
	import xm.manager.StageManager;
	
	
	/**
	 * @author 강석민
	 */	
	public class CustomBar extends BarBase
	{
		private var homeTabBtn : SWCButton, optionTabBtn : SWCButton, logoutTabBtn : SWCButton;
		
		/**
		 * constructor 
		 */	
		public function CustomBar()
		{
			super();
		}
		
		/**
		 * updateDisplayList
		 */		
		override public function updateDisplayList( enforce : Boolean = false ):void
		{
			super.updateDisplayList(enforce);
			
		}
		
		//-----------------------------------------------------------------------------------
		// life cycle functions
		//-----------------------------------------------------------------------------------
		
		/**
		 * 이벤트 발생 없음. 단순 호출용 API.<br />
		 * <br />
		 * createChildren
		 */		
		override public function createChildren():void
		{
			super.createChildren();
			
			var availableWidth : Number, s : Stage;
			s = StageManager.getInstance().stage;
			availableWidth = s.stageWidth;
			
			//탭
			homeTabBtn = MakeChildrenUtil.makeSwcBtn( new BTN_TAB_0, "bg" );
			homeTabBtn.addEventListener(MouseEvent.CLICK , onHomeClick );
			this.addChild( homeTabBtn );
			
			optionTabBtn = MakeChildrenUtil.makeSwcBtn( new BTN_TAB_1, "bg" );
			optionTabBtn.addEventListener(MouseEvent.CLICK , onOptionClick );
			optionTabBtn.x = homeTabBtn.x + homeTabBtn.width;
			this.addChild( optionTabBtn );
			
			logoutTabBtn = MakeChildrenUtil.makeSwcBtn( new BTN_TAB_2, "bg" );
			logoutTabBtn.addEventListener(MouseEvent.CLICK , onLogoutClick );
			logoutTabBtn.x = optionTabBtn.x + optionTabBtn.width;
			this.addChild( logoutTabBtn );
		}
		
		
		/**
		 * 이벤트 발생 없음. 단순 호출용 API.<br />
		 * </ br>
		 * createComplete
		 */		
		override public function creationComplete():void
		{
			super.creationComplete();
			
		}
		
		
		/**
		 * 이벤트 발생 없음. 단순 호출용 API.<br />
		 * </ br>
		 * add ( 화면에 붙자마자 발생 )
		 */	
		override public function add():void
		{
			super.add();
		}
		
		
		/**
		 * 이벤트 발생 없음. 단순 호출용 API.<br />
		 * remove ( 화면에서 떨어지자마자 발생 )</ br>
		 * </ br>
		 * 초기화 메서드로 적당함.
		 */			
		override public function remove():void
		{
			super.remove();
		}
		
		
		/**
		 * 이벤트 발생 없음. 단순 호출용 API.<br />
		 * </ br>
		 * destroy
		 */			
		override public function destroy():void
		{
			super.destroy();
			
		}
		
		//-----------------------------------------------------------------------------------
		// setter / getter
		//-----------------------------------------------------------------------------------
		//-----------------------------------------------------------------------------------
		// protected functions
		//-----------------------------------------------------------------------------------
		//-----------------------------------------------------------------------------------
		// internal functions
		//-----------------------------------------------------------------------------------
		//-----------------------------------------------------------------------------------
		// private functions
		//-----------------------------------------------------------------------------------
		//-----------------------------------------------------------------------------------
		// event handler
		//-----------------------------------------------------------------------------------
		/**
		 * 		홈클릭
		 */		
		private function onHomeClick(e:MouseEvent):void
		{
		}
		
		/**
		 * 		개인정보 변경 클릭
		 */		
		private function onOptionClick(e:MouseEvent):void
		{
		}
		
		/**
		 * 		로그아웃 클릭
		 */		
		private function onLogoutClick(e:MouseEvent):void
		{
		}
		
		
		
		
	}
}